#include <asm/asm.h>
#include <asm/regdef.h>
#include <cpu.h>
#include <asm/context.h>
#include <inst_ex_test.h>

####LEAF(n66_eret_ex_test)
    .globl n66_eret_ex_test
n66_eret_ex_test:
    .set noreorder
    li  a0, 0x42
###test inst
    TEST_ERET_EX(0x7f1bb123, 0x7f1bb123)
    TEST_ERET_EX(0x696202d1, 0x696202d1)
    TEST_ERET_EX(0x8419f10b, 0x8419f10b)
    TEST_ERET_EX(0xdbe7ea73, 0xdbe7ea73)
    TEST_ERET_EX(0xe7a1f9a5, 0xe7a1f9a5)
    TEST_ERET_EX(0xa8b07b0f, 0xa8b07b0f)
    TEST_ERET_EX(0x6982c4cb, 0x6982c4cb)
    TEST_ERET_EX(0x3ee78305, 0x3ee78305)
    TEST_ERET_EX(0x1e3fc92a, 0x1e3fc92a)
    TEST_ERET_EX(0x88a85191, 0x88a85191)
    TEST_ERET_EX(0x038de381, 0x038de381)
    TEST_ERET_EX(0x277bcf2b, 0x277bcf2b)
    TEST_ERET_EX(0xaf44e682, 0xaf44e682)
    TEST_ERET_EX(0x44a22c91, 0x44a22c91)
    TEST_ERET_EX(0x7f50e753, 0x7f50e753)
    TEST_ERET_EX(0xf60b3049, 0xf60b3049)
    TEST_ERET_EX(0x4ada4c35, 0x4ada4c35)
    TEST_ERET_EX(0x6f84f236, 0x6f84f236)
    TEST_ERET_EX(0xbd2fb172, 0xbd2fb172)
    TEST_ERET_EX(0x07383563, 0x07383563)
    TEST_ERET_EX(0xe78e72ff, 0xe78e72ff)
    TEST_ERET_EX(0x7e977d13, 0x7e977d13)
    TEST_ERET_EX(0x2dba8041, 0x2dba8041)
    TEST_ERET_EX(0xff3c9c81, 0xff3c9c81)
    TEST_ERET_EX(0x475c8b43, 0x475c8b43)
    TEST_ERET_EX(0x3270bf02, 0x3270bf02)
    TEST_ERET_EX(0x658be6e1, 0x658be6e1)
    TEST_ERET_EX(0x4042fc11, 0x4042fc11)
    TEST_ERET_EX(0x5ea74081, 0x5ea74081)
    TEST_ERET_EX(0xe4870f56, 0xe4870f56)
    TEST_ERET_EX(0x4109e7e7, 0x4109e7e7)
    TEST_ERET_EX(0x515a030e, 0x515a030e)
    TEST_ERET_EX(0x4ee86b22, 0x4ee86b22)
    TEST_ERET_EX(0xf068ce07, 0xf068ce07)
    TEST_ERET_EX(0x9a7044d7, 0x9a7044d7)
    TEST_ERET_EX(0x8d810316, 0x8d810316)
    TEST_ERET_EX(0x740d0cd9, 0x740d0cd9)
    TEST_ERET_EX(0xdf302e83, 0xdf302e83)
    TEST_ERET_EX(0xeb1e7f6a, 0xeb1e7f6a)
    TEST_ERET_EX(0x33d51e1d, 0x33d51e1d)
    TEST_ERET_EX(0xc8ace479, 0xc8ace479)
    TEST_ERET_EX(0x66205705, 0x66205705)
    TEST_ERET_EX(0x248ce526, 0x248ce526)
    TEST_ERET_EX(0xdc4a94f2, 0xdc4a94f2)
    TEST_ERET_EX(0xcbbf6cf1, 0xcbbf6cf1)
    TEST_ERET_EX(0xd6d848c3, 0xd6d848c3)
    TEST_ERET_EX(0xff8d128b, 0xff8d128b)
    TEST_ERET_EX(0xcd95a6d5, 0xcd95a6d5)
    TEST_ERET_EX(0x49d3c883, 0x49d3c883)
    TEST_ERET_EX(0xf87f687f, 0xf87f687f)
    TEST_ERET_EX(0x01598821, 0x01598821)
    TEST_ERET_EX(0x27c978a2, 0x27c978a2)
    TEST_ERET_EX(0x80c68446, 0x80c68446)
    TEST_ERET_EX(0x48bd5c97, 0x48bd5c97)
    TEST_ERET_EX(0xe35d4f36, 0xe35d4f36)
    TEST_ERET_EX(0x7c586883, 0x7c586883)
    TEST_ERET_EX(0xafdfe99e, 0xafdfe99e)
    TEST_ERET_EX(0x0418cf4f, 0x0418cf4f)
    TEST_ERET_EX(0xa9dd6b83, 0xa9dd6b83)
    TEST_ERET_EX(0xbba73d9b, 0xbba73d9b)
    TEST_ERET_EX(0x43a0e2a3, 0x43a0e2a3)
    TEST_ERET_EX(0x7d5150af, 0x7d5150af)
    TEST_ERET_EX(0x586faac9, 0x586faac9)
    TEST_ERET_EX(0x27f3fb9b, 0x27f3fb9b)
    TEST_ERET_EX(0x90e14ba1, 0x90e14ba1)
    TEST_ERET_EX(0x143e796b, 0x143e796b)
    TEST_ERET_EX(0x88a27582, 0x88a27582)
    TEST_ERET_EX(0xb291ed02, 0xb291ed02)
    TEST_ERET_EX(0xd9e46f21, 0xd9e46f21)
    TEST_ERET_EX(0x17f5e641, 0x17f5e641)
    TEST_ERET_EX(0xa26ef662, 0xa26ef662)
    TEST_ERET_EX(0x590b1ee9, 0x590b1ee9)
    TEST_ERET_EX(0x9a2a4cd2, 0x9a2a4cd2)
    TEST_ERET_EX(0x25e97db3, 0x25e97db3)
    TEST_ERET_EX(0x31f26525, 0x31f26525)
    TEST_ERET_EX(0x039647e5, 0x039647e5)
    TEST_ERET_EX(0xa1a85991, 0xa1a85991)
    TEST_ERET_EX(0xd86e3f0b, 0xd86e3f0b)
    TEST_ERET_EX(0x4d843543, 0x4d843543)
    TEST_ERET_EX(0x25d25f42, 0x25d25f42)
    TEST_ERET_EX(0x501b7422, 0x501b7422)
    TEST_ERET_EX(0x14d31d01, 0x14d31d01)
    TEST_ERET_EX(0x413f7de2, 0x413f7de2)
    TEST_ERET_EX(0x09242111, 0x09242111)
    TEST_ERET_EX(0xa07a55fe, 0xa07a55fe)
    TEST_ERET_EX(0xd24547f6, 0xd24547f6)
    TEST_ERET_EX(0xa744c403, 0xa744c403)
    TEST_ERET_EX(0xfa37bfcd, 0xfa37bfcd)
    TEST_ERET_EX(0x04ef10e1, 0x04ef10e1)
    TEST_ERET_EX(0xb9def03a, 0xb9def03a)
    TEST_ERET_EX(0xf35578ad, 0xf35578ad)
    TEST_ERET_EX(0x1218e41d, 0x1218e41d)
    TEST_ERET_EX(0xa4c3059a, 0xa4c3059a)
    TEST_ERET_EX(0xf2758602, 0xf2758602)
    TEST_ERET_EX(0xd78cb343, 0xd78cb343)
    TEST_ERET_EX(0x6fad7896, 0x6fad7896)
    TEST_ERET_EX(0xf7ff7d01, 0xf7ff7d01)
    TEST_ERET_EX(0x8eef12a2, 0x8eef12a2)
    TEST_ERET_EX(0x18299cfb, 0x18299cfb)
    TEST_ERET_EX(0xfaf83405, 0xfaf83405)
    TEST_ERET_EX(0xdb6d16d7, 0xdb6d16d7)
    TEST_ERET_EX(0x224518d5, 0x224518d5)
    TEST_ERET_EX(0xbebf4339, 0xbebf4339)
    TEST_ERET_EX(0xc5597775, 0xc5597775)
    TEST_ERET_EX(0x4cfa16a1, 0x4cfa16a1)
    TEST_ERET_EX(0x4af0a4c2, 0x4af0a4c2)
    TEST_ERET_EX(0x3d5eb37d, 0x3d5eb37d)
    TEST_ERET_EX(0x56f7516d, 0x56f7516d)
    TEST_ERET_EX(0x7ac6b1ef, 0x7ac6b1ef)
    TEST_ERET_EX(0x8d675922, 0x8d675922)
    TEST_ERET_EX(0xd6fe4733, 0xd6fe4733)
    TEST_ERET_EX(0xd600a5f1, 0xd600a5f1)
    TEST_ERET_EX(0x9202d1b1, 0x9202d1b1)
    TEST_ERET_EX(0x92b174ff, 0x92b174ff)
    TEST_ERET_EX(0xcd90a286, 0xcd90a286)
    TEST_ERET_EX(0x54f66e0d, 0x54f66e0d)
    TEST_ERET_EX(0xb7345c03, 0xb7345c03)
    TEST_ERET_EX(0x90582dad, 0x90582dad)
    TEST_ERET_EX(0x44a17766, 0x44a17766)
    TEST_ERET_EX(0x05924301, 0x05924301)
    TEST_ERET_EX(0x46473967, 0x46473967)
    TEST_ERET_EX(0xd1639591, 0xd1639591)
    TEST_ERET_EX(0xa445cc03, 0xa445cc03)
    TEST_ERET_EX(0x9312182d, 0x9312182d)
    TEST_ERET_EX(0xa318d432, 0xa318d432)
    TEST_ERET_EX(0x5a4b28b5, 0x5a4b28b5)
    TEST_ERET_EX(0x8431b5da, 0x8431b5da)
    TEST_ERET_EX(0x3e932db6, 0x3e932db6)
    TEST_ERET_EX(0x4cb3c5c1, 0x4cb3c5c1)
    TEST_ERET_EX(0xbe0935bd, 0xbe0935bd)
    TEST_ERET_EX(0xedeedba5, 0xedeedba5)
    TEST_ERET_EX(0x9f474cbd, 0x9f474cbd)
    TEST_ERET_EX(0x2186cb42, 0x2186cb42)
    TEST_ERET_EX(0x55700ab5, 0x55700ab5)
    TEST_ERET_EX(0xe6aea127, 0xe6aea127)
    TEST_ERET_EX(0x2f137e17, 0x2f137e17)
    TEST_ERET_EX(0xed229593, 0xed229593)
    TEST_ERET_EX(0x1794f141, 0x1794f141)
    TEST_ERET_EX(0x250508ea, 0x250508ea)
    TEST_ERET_EX(0x41de85da, 0x41de85da)
    TEST_ERET_EX(0xe4e7f165, 0xe4e7f165)
    TEST_ERET_EX(0x93cde6f2, 0x93cde6f2)
    TEST_ERET_EX(0x96f42ad6, 0x96f42ad6)
    TEST_ERET_EX(0x9c28e582, 0x9c28e582)
    TEST_ERET_EX(0x471dc0a7, 0x471dc0a7)
    TEST_ERET_EX(0x34bd0cc3, 0x34bd0cc3)
    TEST_ERET_EX(0xeaad0863, 0xeaad0863)
    TEST_ERET_EX(0x01a52d9b, 0x01a52d9b)
    TEST_ERET_EX(0xf28cedc5, 0xf28cedc5)
    TEST_ERET_EX(0xf7c61f03, 0xf7c61f03)
    TEST_ERET_EX(0x5cd35342, 0x5cd35342)
    TEST_ERET_EX(0xf757f142, 0xf757f142)
    TEST_ERET_EX(0xfcd98a5b, 0xfcd98a5b)
    TEST_ERET_EX(0x6f3bd519, 0x6f3bd519)
    TEST_ERET_EX(0xef0c6f69, 0xef0c6f69)
    TEST_ERET_EX(0x509104d5, 0x509104d5)
    TEST_ERET_EX(0x785a2c01, 0x785a2c01)
    TEST_ERET_EX(0xdb7476a6, 0xdb7476a6)
    TEST_ERET_EX(0x16abe3b1, 0x16abe3b1)
    TEST_ERET_EX(0x8c396f41, 0x8c396f41)
    TEST_ERET_EX(0x7c93e0c1, 0x7c93e0c1)
    TEST_ERET_EX(0xc34c1ec2, 0xc34c1ec2)
    TEST_ERET_EX(0x5645522b, 0x5645522b)
    TEST_ERET_EX(0x9a473791, 0x9a473791)
    TEST_ERET_EX(0xd6ab8ab5, 0xd6ab8ab5)
    TEST_ERET_EX(0xcff18d12, 0xcff18d12)
    TEST_ERET_EX(0xd29cf2b3, 0xd29cf2b3)
    TEST_ERET_EX(0x4274ca5d, 0x4274ca5d)
    TEST_ERET_EX(0x21f20be2, 0x21f20be2)
    TEST_ERET_EX(0x7c726f42, 0x7c726f42)
    TEST_ERET_EX(0x0203d6c3, 0x0203d6c3)
    TEST_ERET_EX(0x76c8b8f3, 0x76c8b8f3)
    TEST_ERET_EX(0xa5337983, 0xa5337983)
    TEST_ERET_EX(0x9b078573, 0x9b078573)
    TEST_ERET_EX(0x78906a4b, 0x78906a4b)
    TEST_ERET_EX(0x1d223da1, 0x1d223da1)
    TEST_ERET_EX(0x0940d1d1, 0x0940d1d1)
    TEST_ERET_EX(0xe7abf04a, 0xe7abf04a)
    TEST_ERET_EX(0xbf9ada63, 0xbf9ada63)
    TEST_ERET_EX(0x5653834a, 0x5653834a)
    TEST_ERET_EX(0xb163bade, 0xb163bade)
    TEST_ERET_EX(0xceafc53b, 0xceafc53b)
    TEST_ERET_EX(0x15aa5a43, 0x15aa5a43)
    TEST_ERET_EX(0x4eab34d3, 0x4eab34d3)
    TEST_ERET_EX(0x24894096, 0x24894096)
    TEST_ERET_EX(0xd55ad0ef, 0xd55ad0ef)
    TEST_ERET_EX(0x63014629, 0x63014629)
    TEST_ERET_EX(0xf3650d82, 0xf3650d82)
    TEST_ERET_EX(0x7d3a21f6, 0x7d3a21f6)
    TEST_ERET_EX(0x3b4e2c83, 0x3b4e2c83)
    TEST_ERET_EX(0xff1943b3, 0xff1943b3)
    TEST_ERET_EX(0x5c13c04b, 0x5c13c04b)
    TEST_ERET_EX(0x1aa1e91f, 0x1aa1e91f)
    TEST_ERET_EX(0xf44d24fd, 0xf44d24fd)
    TEST_ERET_EX(0x16f2f8f3, 0x16f2f8f3)
    TEST_ERET_EX(0x881d2a81, 0x881d2a81)
    TEST_ERET_EX(0xddacc142, 0xddacc142)
    TEST_ERET_EX(0x552260c6, 0x552260c6)
    TEST_ERET_EX(0x1f881961, 0x1f881961)
    TEST_ERET_EX(0xe58278c5, 0xe58278c5)

###detect exception
###score ++
    addiu s3, s3, 1
###output a0|s3
inst_error:  
    sw s3, 0($23)
    sw a0, 0(s1)
    jr ra
    nop
####END(n66_eret_ex_test)
